Skip to content

perf: Skip no-op image enhancements - #742

Merged
phattmatt merged 1 commit into
fatihak:mainfrom
rusudorin:perf/skip-noop-enhancement
Aug 19, 2026
Merged

perf: Skip no-op image enhancements#742
phattmatt merged 1 commit into
fatihak:mainfrom
rusudorin:perf/skip-noop-enhancement

Conversation

@rusudorin

Copy link
Copy Markdown
Contributor

ImageEnhance.enhance(1.0) still blends over the entire image, so the default settings ran four full-frame passes on every render. Skip any enhancement whose factor is 1.0. Output is identical since a factor of 1.0 returns the original pixels.

ImageEnhance.enhance(1.0) still blends over the entire image, so the
default settings ran four full-frame passes on every render. Skip any
enhancement whose factor is 1.0. Output is identical since a factor of
1.0 returns the original pixels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Optimizes the image rendering pipeline by avoiding expensive, no-op PIL enhancement passes when enhancement factors are left at their defaults, reducing per-render work on constrained devices.

Changes:

  • Replaces four unconditional ImageEnhance.*.enhance(...) calls with a loop over configured enhancements.
  • Skips any enhancement whose factor is 1.0 to avoid full-frame blend passes with no pixel change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@phattmatt
phattmatt self-requested a review August 19, 2026 19:10

@phattmatt phattmatt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rusudorin,

Thanks for your PR, the changes look good!

Matt.

@phattmatt
phattmatt merged commit d427642 into fatihak:main Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants